import {Ref} from "vue";
import {toChineseNumber} from "@/utils";

export interface IWeight {
  label: string;
  value: number;
}

export function useWeightList() {
  const weightList:Ref<IWeight[]> = ref([])

  const getWeightList = (max:number = 20) =>  {
    weightList.value = [];
    for(let i=0; i<max; i++) {
      weightList.value.push({
        label: toChineseNumber(i+1 ) + "级",
        value: i+1,
      })
    }
  }

  return {
    weightList,
    getWeightList,
  }
}
